Genericize Test Functions#2177
Merged
wpaulino merged 3 commits intolightningdevkit:mainfrom Apr 17, 2023
Merged
Conversation
In the coming commits we'll add some additional complexity to the event handling flows, so best to DRY them up before we get there.
Collaborator
Author
|
Assigning val and wilmer cause y'all are already on 2111. |
| &'a test_utils::TestFeeEstimator, &'a test_utils::TestRouter<'a>, | ||
| &'a test_utils::TestLogger>; | ||
|
|
||
| struct ANodeHolder<'a, P: Persist<InMemorySigner>> { |
Contributor
There was a problem hiding this comment.
Can we migrate the BackgroundProcessor utils as well so they can use functional_test_utils?
Collaborator
Author
There was a problem hiding this comment.
I think so, but its a bit big, would have to add a bunch of new accessors and maybe do the chain tracking via the trait too.
1be3caf to
db9cd01
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2177 +/- ##
==========================================
- Coverage 91.36% 91.34% -0.02%
==========================================
Files 102 102
Lines 50369 50401 +32
Branches 50369 50401 +32
==========================================
+ Hits 46018 46040 +22
- Misses 4351 4361 +10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
valentinewallace
left a comment
There was a problem hiding this comment.
LGTM after @wpaulino takes a look
In our test utilities, we generally refer to a `Node` struct which holds a `ChannelManager` and a number of other structs. However, we use the same utilities in benchmarking, where we have a different `Node`-like struct. This made moving from macros to functions entirely impossible, as we end up needing multiple types in a given context. Thus, here, we take the pain and introduce some wrapper traits which encapsulte what we need from `Node`, swapping some of our macros to functions.
This marginally reduces the quantity of code compiled in tests further.
db9cd01 to
cfb9eb9
Compare
Collaborator
Author
|
Squashed with typo fixes: |
wpaulino
approved these changes
Apr 17, 2023
valentinewallace
approved these changes
Apr 17, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the prefactors from #2111 which just set us up to have more functions in testing, avoiding more macros in tests.